Skip to content

feat(ui): Show subagent logs in bounded vertical view#4280

Merged
TheodoreSpeaks merged 3 commits intostagingfrom
feat/subagent-use-thinking
Apr 23, 2026
Merged

feat(ui): Show subagent logs in bounded vertical view#4280
TheodoreSpeaks merged 3 commits intostagingfrom
feat/subagent-use-thinking

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Summary

Subagent output can get pretty in the weeds and the user doesn't need to see all that. Like thinking, we should only display the last few lines to reduce visual noise. Note subagent thinking now renders as plaintext to avoid nested boxes in boxes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Validated locally, tested scrolling, refreshes, aborts.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Screen.Recording.2026-04-23.at.2.38.29.PM.mov

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 23, 2026 10:08pm

Request Review

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@BugBot review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 23, 2026

PR Summary

Medium Risk
Moderate UI behavior change in the chat transcript: subagent thinking/text is collapsed into a scrollable viewport with custom auto-stick-to-bottom logic, which could introduce scroll/overflow regressions while streaming.

Overview
Subagent output in agent groups is now displayed in a bounded, scrollable viewport (max height) with overflow fade indicators, reducing transcript noise.

Subagent thinking blocks are no longer rendered as nested ThinkingBlocks; subagent_text and subagent_thinking are both treated as plain text entries within the group.

While streaming, the viewport auto-sticks to bottom unless the user scrolls upward, using requestAnimationFrame-driven smooth scrolling and wheel/scroll listeners to detach/reattach.

Reviewed by Cursor Bugbot for commit b472ae9. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b472ae9. Configure here.

@TheodoreSpeaks TheodoreSpeaks marked this pull request as ready for review April 23, 2026 22:13
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR introduces a bounded scrollable viewport (BoundedViewport) for subagent logs in the agent group, capping height at 110 px with smooth RAF-driven auto-scroll and fade gradient overlays. It also flattens subagent thinking content to plain text (removing the nested ThinkingBlock) and fixes the abort handler to correctly tag stopped subagent blocks with lane: 'subagent' before persistence.

Confidence Score: 5/5

Safe to merge — changes are UI-only with no data-integrity risk and a correct abort-handler fix.

All three files contain well-scoped, internally consistent changes. The RAF loop is correctly cleaned up via useLayoutEffect's return value, the stickToBottom guard prevents infinite scroll races, and the overflow state update is guarded against spurious re-renders. The lane: 'subagent' addition is consistent with the existing pattern at line 712 and matches the stop-route schema.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx Adds BoundedViewport component wrapping agent items in a 110px max-height scrollable container with RAF-based auto-scroll-to-bottom and fade gradients; removes the thinking AgentGroupItem variant in favour of rendering all subagent text/thinking as plain text.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx Merges subagent_thinking block handling into the subagent_text branch so both are concatenated as plain text items; the dedicated thinking branch (with timing guards and ThinkingBlock rendering) is removed.
apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts Adds lane: 'subagent' to serialized blocks in the stop/abort handler when block.subagent is set, so stopped subagent content is correctly tagged on persistence.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Stream Event Arrives] --> B{Block type?}
    B --> |subagent_text OR\nsubagent_thinking| C[Flatten to text item\nin AgentGroup]
    B --> |subagent_tool_call| D[ToolCallItem\nin AgentGroup]
    B --> |thinking| E[ThinkingBlock\nin main message]
    B --> |text| F[Plain text\nin main message]

    C --> G[AgentGroup renders\nBoundedViewport]
    D --> G
    G --> H{Content overflows\n110px?}
    H --> |Yes| I[Show top/bottom\ngradient fades]
    H --> |No| J[Render without fades]
    I --> K{isStreaming?}
    J --> K
    K --> |Yes + stickToBottom| L[RAF loop scrolls\nto bottom smoothly]
    K --> |No| M[Static view]

    subgraph Stop handler
    N[User stops stream] --> O[Map ContentBlock to\nstop API format]
    O --> P{block.subagent\ntruthy?}
    P --> |Yes| Q[Add lane: subagent]
    P --> |No| R[No lane field]
    end
Loading

Reviews (1): Last reviewed commit: "fix lint" | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks merged commit dcbe7c6 into staging Apr 23, 2026
13 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the feat/subagent-use-thinking branch April 23, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant